import { axios } from '@/utils/request'

const api = {
  getQrcode: '/setting/chain-wechat-upload/qrcode',
  getLoginQrcode: '/setting/chain-wechat-upload/wx-login',
  getPreviewQrcode: '/setting/chain-wechat-upload/preview',
  upload: '/setting/chain-wechat-upload/upload'
}

export default api

export function getQrcode (parameter) {
  return axios({
    url: api.getQrcode,
    method: 'get',
    params: parameter
  })
}

export function getLoginQrcode (parameter) {
  return axios({
    url: api.getLoginQrcode,
    method: 'post',
    data: parameter
  })
}

export function getPreviewQrcode (parameter) {
  return axios({
    url: api.getPreviewQrcode,
    method: 'post',
    data: parameter
  })
}

export function uploadWechat (parameter) {
  return axios({
    url: api.upload,
    method: 'post',
    data: parameter
  })
}
